import requests


class Curd(object):
    @classmethod
    def add_emp(cls, header, json_data):
        url = "http://127.0.0.1:8080/api/sys/user"
        resp = requests.post(url=url, json=json_data, headers=header)
        return resp

    @classmethod
    def del_emp(cls, header, emp_id):
        url = "http://127.0.0.1:8080/api/sys/user/" + emp_id
        resp = requests.delete(url=url, headers=header)
        return resp

    @classmethod
    def put_emp(cls, header, emp_id, json_data):
        url = "http://localhost:8080/api/sys/user/" + emp_id
        resp = requests.put(url=url, json=json_data, headers=header)
        return resp

    @classmethod
    def get_emp(cls, header, emp_id):
        url = "http://127.0.0.1:8080/api/sys/user/" + emp_id
        resp = requests.get(url=url, headers=header)
        return resp
